package com.crazy.practice.boot.even;

import org.springframework.context.ApplicationEvent;

import java.util.Properties;

/**
 * @author panyonghui
 * @describe 配置变更事件
 * @date 2023/4/13 15:11
 */
public class PropertiesChangeEven extends ApplicationEvent {

    /**
     * 变更配置（需要变更的配置）
     */
    private Properties properties;
    /**
     * 旧配置项（配置项原参数）
     */
    private Properties oldProperties;
    /**
     * 新配置项（配置项新参数）
     */
    private Properties newProperties;

    public PropertiesChangeEven(Properties source) {
        super(source);
        this.properties = source;
    }

    @Override
    public Properties getSource() {
        return properties;
    }

    public Properties getOldProperties() {
        return oldProperties;
    }

    public void setOldProperties(Properties oldProperties) {
        this.oldProperties = oldProperties;
    }

    public Properties getNewProperties() {
        return newProperties;
    }

    public void setNewProperties(Properties newProperties) {
        this.newProperties = newProperties;
    }
}
